package com.orientation.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.orientation.handle.EncryptHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 学生
 * </p>
 *
 * @author xuandian
 * @since 2022-3-9
 */
@Data
@EqualsAndHashCode(callSuper = false)
/**
 * 是否自动构建 resultMap 并使用,
 * 只生效与 mp 自动注入的 method,
 * 如果设置 resultMap 则不会进行 resultMap 的自动构建并注入,
 * 只适合个别字段 设置了 typeHandler 或 jdbcType 的情况
 * **/
@TableName(value = "t_student", autoResultMap = true)
@ApiModel(value = "Student对象", description = "学生")
public class Student implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "所在学院ID")
    @TableField("COLLEGE_ID")
    private String collegeId;

    @ApiModelProperty(value = "专业ID")
    @TableField("MAJOR_ID")
    private String majorId;

    @ApiModelProperty(value = "所在班级ID")
//修改置空
    @TableField(value = "CLASS_ID", updateStrategy = FieldStrategy.IGNORED)
    private String classId;

    @ApiModelProperty(value = "学生ID")
    @TableId(value = "SID", type = IdType.ASSIGN_UUID)
    private String sid;

    @ApiModelProperty(value = "学号")
    @TableField("STUDENT_ID")
    private String studentId;

    @ApiModelProperty(value = "学生姓名")
    @TableField("STUDENT_NAME")
    private String studentName;

    @ApiModelProperty(value = "身份证号")
    @TableField("ID_CARD_NO")
    private String idCardNo;

    @ApiModelProperty(value = "手机号")
    @TableField("MOBILE_PHONE")
    private String mobilePhone;

    @ApiModelProperty(value = "性别")
    @TableField("GENDER")
    private String gender;

    @ApiModelProperty(value = "出生日期")
    @TableField("BIRTH")
    private LocalDate birth;

    @ApiModelProperty(value = "头像")
    @TableField("AVATAR")
    private String avatar;

    @ApiModelProperty(value = "民族")
    @TableField("NATION")
    private String nation;

    @ApiModelProperty(value = "政治面貌")
    @TableField("POLITICAL")
    private String political;

    @ApiModelProperty(value = "婚姻状况")
    @TableField("MARITAL")
    private String marital;

    @ApiModelProperty(value = "籍贯（省）")
    @TableField("DOMICILE_PLACE_PROVINCE")
    private String domicilePlaceProvince;

    @ApiModelProperty(value = "籍贯（市）")
    @TableField("DOMICILE_PLACE_CITY")
    private String domicilePlaceCity;

    @ApiModelProperty(value = "户籍地址")
    @TableField("DOMICILE_PLACE_ADDRESS")
    private String domicilePlaceAddress;

    @ApiModelProperty(value = "居住地址")
    @TableField("PRESENT_ADDRESS")
    private String presentAddress;

    @ApiModelProperty(value = "电子邮件")
    @TableField("EMAIL")
    private String email;

    @ApiModelProperty(value = "入学日期")
    @TableField("ENTRY_DATE")
    private LocalDate entryDate;

    @ApiModelProperty(value = "状态")
    @TableField("STATUS")
    private String status;

    @ApiModelProperty(value = "创建人")
    @TableField(value = "CREATE_USER", fill = FieldFill.INSERT)
    private String createUser;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新人")
    @TableField(value = "UPDATE_USER", fill = FieldFill.UPDATE)
    private String updateUser;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "UPDATE_TIME", fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "逻辑删除")
    @TableField("DELETED")
    private Integer deleted;

    @ApiModelProperty(value = "鞋子尺码")
    @TableField("SHOE_SIZE")
    private String shoeSize;

    @ApiModelProperty(value = "身高")
    @TableField("HEIGHT")
    private String height;

    @ApiModelProperty(value = "体重")
    @TableField("WEIGHT")
    private String weight;

    @ApiModelProperty(value = "是否领取服装")
    @TableField("HAS_CLOTHING")
    private Integer hasClothing;

    // @ApiModelProperty(value = "密码")
    @TableField(value = "PASSWORD", typeHandler = EncryptHandler.class)
    //  @TableField(typeHandler = EncryptHandler.class)
    private String password;

    @ApiModelProperty(value = "年级")
    @TableField("GRADE")
    private String grade;
    /**
     * 加入班级日期
     */
    @TableField(value = "ALLOCATE_DATE", updateStrategy = FieldStrategy.IGNORED)
    private LocalDate allocateDate;


    @ApiModelProperty(value = "乐观锁注解字段")
    @TableField(value = "VERSION")
    @Version
    private Integer version;
}
